package com.lzc.controller;

import com.lzc.pojo.vo.Result;
import com.lzc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/im/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 获取登录个人信息
     */
    @GetMapping("/info")
    @ResponseBody
    public Result getUserInfo(){
        return userService.getUserInfo();
    }

    /**
     * 查找用户
     * @param username 账号
     * @return
     */
    @GetMapping("/find/info")
    public Result findUser(@RequestParam("username") String username){
        return userService.findUserByUsername(username);
    }

}
